#!/bin/env ruby
# encoding: utf-8
require_relative '../spec/spec_helper'
require_relative '../spec/commons/user_auth'
require_relative '../spec/commons/check_page'
require_relative '../spec/commons/user_registration_func'

describe "Sign Up page" do
  describe 'Sign up as Employer' do
    before (:all) {
      goto 'https://mutualforce.7bits.it/signUp.html'
      check_signup_page()
      select_list(name: "selectedRole", id: "selectedRole").select "Employer"      
    }
    include_context "User names"
    include_context 'User email'
    include_context 'authorization code'
    include_context "Employer registration"
  end

  describe 'Sign up as Mentor' do
    before (:all) {
      goto 'https://mutualforce.7bits.it/signUp.html'
      check_signup_page()
      select_list(name: "selectedRole", id: "selectedRole").select "Mentor"
    }
    include_context "User names"
    include_context 'User email' 
    include_context 'authorization code'   
  end

  describe 'Sign up as Mentee' do
    before (:all) {
      goto 'https://mutualforce.7bits.it/signUp.html'
      check_signup_page()
      select_list(name: "selectedRole", id: "selectedRole").select "Mentee"      
    }
    include_context "User names"
    include_context 'User email'    
    include_context 'authorization code'
  end  

  # 1 fill  all inputs
    # 2 check email
    # 3 get the letter => employer check his email
    # 4 employer approve 
    # 5 user can log_in
    # 6 his role is mentor
  # describe 'Positive test for Mentor registration' do
  #   it 'submit correct values' do
  #     goto 'https://mutualforce.7bits.it/signUp.html'
  #     select_list(name: "selectedRole", id: "selectedRole").select "Mentor"
  #     text_field(class: "b-form__input_text", name: "firstName", id: "firstName").clear
  #     text_field(class: "b-form__input_text", name: "firstName", id: "firstName").set "JohnyB"
  #     text_field(class: "b-form__input_text", name: "lastName", id: "lastName").clear
  #     text_field(class: "b-form__input_text", name: "lastName", id: "lastName").set "Good"
  #     text_field(class: "b-form__input_text", name: "name", id: "name").clear
  #     text_field(class: "b-form__input_text", name: "name", id: "name").set  'mutual_bb_koun@mail.ru' 
  #     text_field(class: "b-form__input_text", name: "registerCode", id: "registerCode").clear
  #     text_field(class: "b-form__input_text", name: "registerCode", id: "registerCode").set '7+8=15'
  #     button(text: "Submit").click
  #     browser.wait(3)
  #     goto 'http://www.mail.ru'
  #     text_field( id: "mailbox__login").set 'mutual_bb_koun'
  #     select_list(id: "mailbox__login__domain").select '@mail.ru'
  #     text_field( id: "mailbox__password").set '123qwe+'
  #     button(id: "mailbox__auth__button").click
  #     a(href: "/messages/inbox/").click
      #(browser.text.include! 'Mutual Force: Reminder').wait_until_present(30)

      #to incoming
      #wait 100 until get a letter
   #  end
   # end
    
  

end



